3.4.48 \(\int \frac {\log ^2(c (a+b x)^n)}{d+e x+f x^2} \, dx\) [348]

Optimal. Leaf size=372 \[ \frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e-\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e+\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}+\frac {2 n \log \left (c (a+b x)^n\right ) \text {Li}_2\left (\frac {2 f (a+b x)}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {2 n \log \left (c (a+b x)^n\right ) \text {Li}_2\left (\frac {2 f (a+b x)}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {2 n^2 \text {Li}_3\left (\frac {2 f (a+b x)}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}+\frac {2 n^2 \text {Li}_3\left (\frac {2 f (a+b x)}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}} \]

[Out]

ln(c*(b*x+a)^n)^2*ln(-b*(e+2*f*x-(-4*d*f+e^2)^(1/2))/(2*a*f-b*(e-(-4*d*f+e^2)^(1/2))))/(-4*d*f+e^2)^(1/2)-ln(c
*(b*x+a)^n)^2*ln(-b*(e+2*f*x+(-4*d*f+e^2)^(1/2))/(2*a*f-b*(e+(-4*d*f+e^2)^(1/2))))/(-4*d*f+e^2)^(1/2)+2*n*ln(c
*(b*x+a)^n)*polylog(2,2*f*(b*x+a)/(2*a*f-b*(e-(-4*d*f+e^2)^(1/2))))/(-4*d*f+e^2)^(1/2)-2*n*ln(c*(b*x+a)^n)*pol
ylog(2,2*f*(b*x+a)/(2*a*f-b*(e+(-4*d*f+e^2)^(1/2))))/(-4*d*f+e^2)^(1/2)-2*n^2*polylog(3,2*f*(b*x+a)/(2*a*f-b*(
e-(-4*d*f+e^2)^(1/2))))/(-4*d*f+e^2)^(1/2)+2*n^2*polylog(3,2*f*(b*x+a)/(2*a*f-b*(e+(-4*d*f+e^2)^(1/2))))/(-4*d
*f+e^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.28, antiderivative size = 372, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 5, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2465, 2443, 2481, 2421, 6724} \begin {gather*} \frac {2 n \log \left (c (a+b x)^n\right ) \text {PolyLog}\left (2,\frac {2 f (a+b x)}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {2 n \log \left (c (a+b x)^n\right ) \text {PolyLog}\left (2,\frac {2 f (a+b x)}{2 a f-b \left (\sqrt {e^2-4 d f}+e\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {2 n^2 \text {PolyLog}\left (3,\frac {2 f (a+b x)}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}+\frac {2 n^2 \text {PolyLog}\left (3,\frac {2 f (a+b x)}{2 a f-b \left (\sqrt {e^2-4 d f}+e\right )}\right )}{\sqrt {e^2-4 d f}}+\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (-\sqrt {e^2-4 d f}+e+2 f x\right )}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (\sqrt {e^2-4 d f}+e+2 f x\right )}{2 a f-b \left (\sqrt {e^2-4 d f}+e\right )}\right )}{\sqrt {e^2-4 d f}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Log[c*(a + b*x)^n]^2/(d + e*x + f*x^2),x]

[Out]

(Log[c*(a + b*x)^n]^2*Log[-((b*(e - Sqrt[e^2 - 4*d*f] + 2*f*x))/(2*a*f - b*(e - Sqrt[e^2 - 4*d*f])))])/Sqrt[e^
2 - 4*d*f] - (Log[c*(a + b*x)^n]^2*Log[-((b*(e + Sqrt[e^2 - 4*d*f] + 2*f*x))/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f]
)))])/Sqrt[e^2 - 4*d*f] + (2*n*Log[c*(a + b*x)^n]*PolyLog[2, (2*f*(a + b*x))/(2*a*f - b*(e - Sqrt[e^2 - 4*d*f]
))])/Sqrt[e^2 - 4*d*f] - (2*n*Log[c*(a + b*x)^n]*PolyLog[2, (2*f*(a + b*x))/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f])
)])/Sqrt[e^2 - 4*d*f] - (2*n^2*PolyLog[3, (2*f*(a + b*x))/(2*a*f - b*(e - Sqrt[e^2 - 4*d*f]))])/Sqrt[e^2 - 4*d
*f] + (2*n^2*PolyLog[3, (2*f*(a + b*x))/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f]))])/Sqrt[e^2 - 4*d*f]

Rule 2421

Int[(Log[(d_.)*((e_) + (f_.)*(x_)^(m_.))]*((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.))/(x_), x_Symbol] :> Simp
[(-PolyLog[2, (-d)*f*x^m])*((a + b*Log[c*x^n])^p/m), x] + Dist[b*n*(p/m), Int[PolyLog[2, (-d)*f*x^m]*((a + b*L
og[c*x^n])^(p - 1)/x), x], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IGtQ[p, 0] && EqQ[d*e, 1]

Rule 2443

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_)/((f_.) + (g_.)*(x_)), x_Symbol] :> Simp[Log[e*((
f + g*x)/(e*f - d*g))]*((a + b*Log[c*(d + e*x)^n])^p/g), x] - Dist[b*e*n*(p/g), Int[Log[(e*(f + g*x))/(e*f - d
*g)]*((a + b*Log[c*(d + e*x)^n])^(p - 1)/(d + e*x)), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && NeQ[e*
f - d*g, 0] && IGtQ[p, 1]

Rule 2465

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[
(a + b*Log[c*(d + e*x)^n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, n}, x] && RationalFunct
ionQ[RFx, x] && IntegerQ[p]

Rule 2481

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + Log[(h_.)*((i_.) + (j_.)*(x_))^(m_.)]*
(g_.))*((k_.) + (l_.)*(x_))^(r_.), x_Symbol] :> Dist[1/e, Subst[Int[(k*(x/d))^r*(a + b*Log[c*x^n])^p*(f + g*Lo
g[h*((e*i - d*j)/e + j*(x/e))^m]), x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, j, k, l, n, p, r},
 x] && EqQ[e*k - d*l, 0]

Rule 6724

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rubi steps

\begin {align*} \int \frac {\log ^2\left (c (a+b x)^n\right )}{d+e x+f x^2} \, dx &=\int \left (\frac {2 f \log ^2\left (c (a+b x)^n\right )}{\sqrt {e^2-4 d f} \left (e-\sqrt {e^2-4 d f}+2 f x\right )}-\frac {2 f \log ^2\left (c (a+b x)^n\right )}{\sqrt {e^2-4 d f} \left (e+\sqrt {e^2-4 d f}+2 f x\right )}\right ) \, dx\\ &=\frac {(2 f) \int \frac {\log ^2\left (c (a+b x)^n\right )}{e-\sqrt {e^2-4 d f}+2 f x} \, dx}{\sqrt {e^2-4 d f}}-\frac {(2 f) \int \frac {\log ^2\left (c (a+b x)^n\right )}{e+\sqrt {e^2-4 d f}+2 f x} \, dx}{\sqrt {e^2-4 d f}}\\ &=\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e-\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e+\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {(2 b n) \int \frac {\log \left (c (a+b x)^n\right ) \log \left (\frac {b \left (e-\sqrt {e^2-4 d f}+2 f x\right )}{-2 a f+b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{a+b x} \, dx}{\sqrt {e^2-4 d f}}+\frac {(2 b n) \int \frac {\log \left (c (a+b x)^n\right ) \log \left (\frac {b \left (e+\sqrt {e^2-4 d f}+2 f x\right )}{-2 a f+b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{a+b x} \, dx}{\sqrt {e^2-4 d f}}\\ &=\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e-\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e+\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {(2 n) \text {Subst}\left (\int \frac {\log \left (c x^n\right ) \log \left (\frac {b \left (\frac {-2 a f+b \left (e-\sqrt {e^2-4 d f}\right )}{b}+\frac {2 f x}{b}\right )}{-2 a f+b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt {e^2-4 d f}}+\frac {(2 n) \text {Subst}\left (\int \frac {\log \left (c x^n\right ) \log \left (\frac {b \left (\frac {-2 a f+b \left (e+\sqrt {e^2-4 d f}\right )}{b}+\frac {2 f x}{b}\right )}{-2 a f+b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt {e^2-4 d f}}\\ &=\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e-\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e+\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}+\frac {2 n \log \left (c (a+b x)^n\right ) \text {Li}_2\left (\frac {2 f (a+b x)}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {2 n \log \left (c (a+b x)^n\right ) \text {Li}_2\left (\frac {2 f (a+b x)}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {\left (2 n^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (-\frac {2 f x}{-2 a f+b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt {e^2-4 d f}}+\frac {\left (2 n^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (-\frac {2 f x}{-2 a f+b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt {e^2-4 d f}}\\ &=\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e-\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac {b \left (e+\sqrt {e^2-4 d f}+2 f x\right )}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}+\frac {2 n \log \left (c (a+b x)^n\right ) \text {Li}_2\left (\frac {2 f (a+b x)}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {2 n \log \left (c (a+b x)^n\right ) \text {Li}_2\left (\frac {2 f (a+b x)}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}-\frac {2 n^2 \text {Li}_3\left (\frac {2 f (a+b x)}{2 a f-b \left (e-\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}+\frac {2 n^2 \text {Li}_3\left (\frac {2 f (a+b x)}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {e^2-4 d f}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.18, size = 655, normalized size = 1.76 \begin {gather*} \frac {2 \sqrt {e^2-4 d f} n^2 \tan ^{-1}\left (\frac {e+2 f x}{\sqrt {-e^2+4 d f}}\right ) \log ^2(a+b x)-4 \sqrt {e^2-4 d f} n \tan ^{-1}\left (\frac {e+2 f x}{\sqrt {-e^2+4 d f}}\right ) \log (a+b x) \log \left (c (a+b x)^n\right )+2 \sqrt {e^2-4 d f} \tan ^{-1}\left (\frac {e+2 f x}{\sqrt {-e^2+4 d f}}\right ) \log ^2\left (c (a+b x)^n\right )-\sqrt {-e^2+4 d f} n^2 \log ^2(a+b x) \log \left (1-\frac {2 f (a+b x)}{-b e+2 a f+b \sqrt {e^2-4 d f}}\right )+2 \sqrt {-e^2+4 d f} n \log (a+b x) \log \left (c (a+b x)^n\right ) \log \left (1-\frac {2 f (a+b x)}{-b e+2 a f+b \sqrt {e^2-4 d f}}\right )+\sqrt {-e^2+4 d f} n^2 \log ^2(a+b x) \log \left (1+\frac {2 f (a+b x)}{-2 a f+b \left (e+\sqrt {e^2-4 d f}\right )}\right )-2 \sqrt {-e^2+4 d f} n \log (a+b x) \log \left (c (a+b x)^n\right ) \log \left (1+\frac {2 f (a+b x)}{-2 a f+b \left (e+\sqrt {e^2-4 d f}\right )}\right )+2 \sqrt {-e^2+4 d f} n \log \left (c (a+b x)^n\right ) \text {Li}_2\left (\frac {2 f (a+b x)}{2 a f+b \left (-e+\sqrt {e^2-4 d f}\right )}\right )-2 \sqrt {-e^2+4 d f} n \log \left (c (a+b x)^n\right ) \text {Li}_2\left (\frac {2 f (a+b x)}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )-2 \sqrt {-e^2+4 d f} n^2 \text {Li}_3\left (\frac {2 f (a+b x)}{-b e+2 a f+b \sqrt {e^2-4 d f}}\right )+2 \sqrt {-e^2+4 d f} n^2 \text {Li}_3\left (\frac {2 f (a+b x)}{2 a f-b \left (e+\sqrt {e^2-4 d f}\right )}\right )}{\sqrt {-\left (e^2-4 d f\right )^2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Log[c*(a + b*x)^n]^2/(d + e*x + f*x^2),x]

[Out]

(2*Sqrt[e^2 - 4*d*f]*n^2*ArcTan[(e + 2*f*x)/Sqrt[-e^2 + 4*d*f]]*Log[a + b*x]^2 - 4*Sqrt[e^2 - 4*d*f]*n*ArcTan[
(e + 2*f*x)/Sqrt[-e^2 + 4*d*f]]*Log[a + b*x]*Log[c*(a + b*x)^n] + 2*Sqrt[e^2 - 4*d*f]*ArcTan[(e + 2*f*x)/Sqrt[
-e^2 + 4*d*f]]*Log[c*(a + b*x)^n]^2 - Sqrt[-e^2 + 4*d*f]*n^2*Log[a + b*x]^2*Log[1 - (2*f*(a + b*x))/(-(b*e) +
2*a*f + b*Sqrt[e^2 - 4*d*f])] + 2*Sqrt[-e^2 + 4*d*f]*n*Log[a + b*x]*Log[c*(a + b*x)^n]*Log[1 - (2*f*(a + b*x))
/(-(b*e) + 2*a*f + b*Sqrt[e^2 - 4*d*f])] + Sqrt[-e^2 + 4*d*f]*n^2*Log[a + b*x]^2*Log[1 + (2*f*(a + b*x))/(-2*a
*f + b*(e + Sqrt[e^2 - 4*d*f]))] - 2*Sqrt[-e^2 + 4*d*f]*n*Log[a + b*x]*Log[c*(a + b*x)^n]*Log[1 + (2*f*(a + b*
x))/(-2*a*f + b*(e + Sqrt[e^2 - 4*d*f]))] + 2*Sqrt[-e^2 + 4*d*f]*n*Log[c*(a + b*x)^n]*PolyLog[2, (2*f*(a + b*x
))/(2*a*f + b*(-e + Sqrt[e^2 - 4*d*f]))] - 2*Sqrt[-e^2 + 4*d*f]*n*Log[c*(a + b*x)^n]*PolyLog[2, (2*f*(a + b*x)
)/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f]))] - 2*Sqrt[-e^2 + 4*d*f]*n^2*PolyLog[3, (2*f*(a + b*x))/(-(b*e) + 2*a*f +
 b*Sqrt[e^2 - 4*d*f])] + 2*Sqrt[-e^2 + 4*d*f]*n^2*PolyLog[3, (2*f*(a + b*x))/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f]
))])/Sqrt[-(e^2 - 4*d*f)^2]

________________________________________________________________________________________

Maple [F]
time = 0.69, size = 0, normalized size = 0.00 \[\int \frac {\ln \left (c \left (b x +a \right )^{n}\right )^{2}}{f \,x^{2}+e x +d}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(ln(c*(b*x+a)^n)^2/(f*x^2+e*x+d),x)

[Out]

int(ln(c*(b*x+a)^n)^2/(f*x^2+e*x+d),x)

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(c*(b*x+a)^n)^2/(f*x^2+e*x+d),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*d*f-%e^2>0)', see `assume?`
for more det

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(c*(b*x+a)^n)^2/(f*x^2+e*x+d),x, algorithm="fricas")

[Out]

integral(log((b*x + a)^n*c)^2/(f*x^2 + x*e + d), x)

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(ln(c*(b*x+a)**n)**2/(f*x**2+e*x+d),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(c*(b*x+a)^n)^2/(f*x^2+e*x+d),x, algorithm="giac")

[Out]

integrate(log((b*x + a)^n*c)^2/(f*x^2 + x*e + d), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\ln \left (c\,{\left (a+b\,x\right )}^n\right )}^2}{f\,x^2+e\,x+d} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(log(c*(a + b*x)^n)^2/(d + e*x + f*x^2),x)

[Out]

int(log(c*(a + b*x)^n)^2/(d + e*x + f*x^2), x)

________________________________________________________________________________________